package com.nuance.assignment.fileInfo.server.validation.validator;

import java.io.File;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

import com.nuance.assignment.fileInfo.server.validation.constraints.PathExists;

public class PathExistsValidator implements
		ConstraintValidator<PathExists, String> {

	@Override
	public void initialize(PathExists constraintAnnotation) {

	}

	@Override
	public boolean isValid(String value, ConstraintValidatorContext context) {		
		return new File(value).exists();
	}

}
